import uuid

random_uuid = uuid.uuid4()
from user.models import SysRole

if __name__ == '__main__':
    roleList = SysRole.objects.raw("select role_id from sys_user_role where user_id=" + 1)
    print("这个是角色列表", roleList)
import hashlib
from datetime import datetime

# import redis
#
#
# # import redis
#
# def test_redis_connection():
#     try:
#         # 创建 Redis 连接
#         redis_host = '127.0.0.1'  # Redis 服务器地址
#         redis_port = 6379  # Redis 服务器端口
#         redis_db = 1  # 使用的数据库编号
#         redis_password = '123456'
#
#         # 连接到 Redis
#         r = redis.Redis(host=redis_host, port=redis_port, db=redis_db, password=redis_password)
#
#         # 测试连接
#         r.set('test_key', 'test_value')
#         value = r.get('test_key')
#
#         if value == b'test_value':
#             print("Redis 连接成功！")
#         else:
#             print("Redis 连接失败，无法设置或获取键值对。")
#
#     except redis.ConnectionError as e:
#         print(f"Redis 连接失败: {e}")
#     except Exception as e:
#         print(f"发生错误: {e}")
#
#
# if __name__ == "__main__":
#     test_redis_connection()
